/*
 * Copyright (C) 2012  E-dance Studio Harbin Institute of Technology 
 * Project:campusmobile
 * Author: 初楷博
 * Create Date: 2012-6-8下午01:48:51
 */
package hit.edance.campusmobile.chat.model;

import java.util.HashMap;

import android.app.Activity;

/**   
 * activity 栈
 * 
 * @Project campusmobile
 * @Package hit.edance.campusmobile.chat.model
 * @Class ActivityKiller
 * @Date 2012-6-8 下午01:48:51
 * @author 初楷博
 * @version 1.0
 * @since 1.0
 */
public class ActivityKiller {
	public static HashMap<Integer, Activity> activityList = new HashMap<Integer, Activity>();
	
	public static void addActivity(int hashcode,Activity acty){
		activityList.put(hashcode, acty);
	}
	public static void killAll(){
		Activity activity = null;
		for(Integer key : activityList.keySet()){
			if((activity = activityList.get(key)) != null){
				activity.finish();
			}
		}
		activityList.clear();
	}
	public static void killActivityByHashCode(int key){
		if(activityList.get(key)!=null)
			activityList.remove(key);
	}
}
